EISSINGER UTILITIES Version 3.0a Copyright 1989-1991, Michael A. Eissinger All Rights Reserved. License Statement This software is protected by both United States Copyright Law and International Treaty provisions. Therefore, all conditions pertaining to other publications also apply to this software, with the following exceptions. The licensee of this software may make archival copies of this software for the sole purpose of backing up this software and protecting the licensee's investment from loss. This version of this software is released as "Shareware". As such, the user may also make copies of the software and relating documentation and distribute those copies freely as long as no changes are made to either the software or documentation and as long as no amount above the cost of producing the physical copy (not to exceed $10.00) is charged for the copy of the software and documentation. The software must also be distributed with the relating documentation attached and the package must be distributed as a single package. If the user uses the software regularly, he/she is required to register directly with the owner of the Copyright - Michael A. Eissinger, Microcomputer Consultant. Registration includes a free update to the latest version of the software, free periodic updates for one year, printed documentation and free phone support. Unregistered users can not get any support, whatsoever. Warranty Michael A. Eissinger, Microcomputer Consultant specifically disclaims all warranties, expressed or implied, including but not limited to implied warranties of merchantability and fitness for a particular purpose, and the program license granted herein in particular and without limiting operation of the program license with respect to any particular application, use or purpose. In no event shall Michael A. Eissinger, Microcomputer Consultant, or employees or agents of Michael A. Eissinger, Microcomputer Consultant be liable for any loss of profit or any other commercial damage, including, but not limited to, special, incidental, consequential or other damages. This statement shall be construed, interpreted and governed by the laws of the State of California. Introduction Even though many users new to personal computers are opting to stay away from the DOS command line in favor of "environments" such as MS-Windows, DeskView, Presentation Manager or others, others still rely on batch files and the DOS prompt for many functions. This set of utilities is designed for those who use the command line and for system integrators, consultants or anyone setting up or using a system. These utilities add a rich variety of DOS commands for everything from making your batch file displays pretty to checking the system hardware and configuration. With a few exceptions each of these utilities has been designed to do one function. Many of them are only useful when used within a batch file, in fact they're intended to be an extension of the batch programming language and provide functions that have not been available before. Some of these utilities are alterations of existing DOS commands, some are based loosely on utilities available in UNIX, others are just functions that the author wanted or needed for a specific purpose. There are several broad groupings within this package. The batch commands can position the cursor on the screen, change the color of the screen, clear a portion of the screen, display text on the screen, prompt the user for a response and branch within a batch file based on the user's response or display the date and time in a variety of formats. The batch file building utilities can build a batch file from a wild card specification, paste two files together or interleave lines from two files to form a new file. The batch enhancement commands provide many options to make Batch a more powerful programming language. Display enhancements, sound and user input are included, as well as logging capabilities and the ability to cause execution to wait until a specified time. The DOS enhancement commands provide new functions for fitting files onto multiple diskettes, deleting directories and files, etc. The text file utilities can change the case of all of the text in a file or list sections of a text or source code file, or change a specific string within a text file. The system utilities report a variety of hardware/software options and the current configuration of a system. This is Version 3.0 of this utility package. Version 1.0 was intended primarily for Turbo Pascal programmers and included several batch commands and utilities. Version 2.0 still carried most of the programmer's utilities, however the DOS utilities had been expanded to the point that this was no longer a set of programmer's tools. Version 3.0 no longer contains any of the original programmer's utilities. These may be released as a separate package later. New batch enhancement commands and several new DOS commands have been added. Every existing utility and program has been enhanced. In a few cases this is only an increase in execution speed, but in most cases, enhancements greatly increase the functionality of the utility or program. HWare.exe has been removed from Version 3.0 of the Eissinger Utilities and released as a separate package. Registered users of Version 2.0 will recieve both The Eissinger Utilities, Version 3.0 and HWare free of charge. Getting Started All of the files that make up the system are stored within a compressed file called UTILS3.EXE . . . this is a self- extracting utility and no other program is needed to uncompress the files contained within UTILS3.EXE. To unarchive these, copy UTILS3.EXE to your DOS or Utility directory (or any directory on the system path) and type UTILS3, followed by tapping [Return]/ [Enter]. You can delete the UTILS3.EXE file once everything has been unarchived. BLDBAT.EXE batch file generator MELD.EXE Unix-like command PASTE.EXE Unix-like command CLEAR.EXE Erases all or part of the screen COLOR.EXE change the screen colors BORDER.EXE change/set the color of the monitors border TONE.EXE generate beeps and other sounds EKO.EXE display one or more lines from file EKOFLASH.EXE display text, setting color and flash EKOBOX.EXE display one or more text lines in box GETRESP.EXE accept a keystroke for branching GETYN.EXE accept either Y or N for branching PAUSEC.EXE modified pause command KURSOR.EXE turn cursor on/off or change size PUTCURS.EXE position the cursor on a particular line TODAY.EXE display the current clock date NOW.EXE display the current clock time TYP.EXE modified type command DELDIR.EXE erase a directory and it's files DELETE.EXE erase with verification KOPY.EXE fits files onto diskettes LOG.EXE log an entry to a log file REPEAT.EXE repeat any command any number of times EXEC.EXE execute multiple commands WAIT.EXE wait until a specified time REBOOT.EXE Software Reboot Command FF.EXE Issues a form feed to printer HEAD.EXE Unix-like command TAIL.EXE Unix-like command CASE.EXE change case of text file: upper or lower COMPTEXT.EXE text file compare utility CLOCK.BAT demo batch file GRMENU.BAT demo batch file GRMENU.TXT file used by demo batch file EIHELP.BAT demo batch file SEd - System File Editor SEd - System File Editor - is a full-featured text editor that can replace EDLIN and the DOS 5.0 Editor completely. For versions of DOS prior to 5.0, SEd is much more powerful than EDLIN. DOS 5.0 users won't need to keep BASIC loaded just to use the editor. SEd is primarily designed to allow easy access to your AUTOEXEC.BAT and CONFIG.SYS files, since these two files are automatically called into editor windows as soon as SEd is loaded. SEd can do much more, since it is also a fully CUA compliant, mouse driven, multi-window text editor with search and replace, and cut and paste options. An ASCII Table and Calculator are also included in SEd. SEd can also automatically open additional files at startup if you pass the names of the files to SEd on the command line. For example . . . SED READ.ME NOTES.TXT will automatically open the AUTOEXEC.BAT and CONFIG.SYS files from the root directory, and it will automatically open READ.ME and NOTES.TXT from the current directory. If the files aren't found SEd will open new files and give them the names from the command line. The SEd menu structure and operation is fully CUA compliant and should be self explanitory. The following covers all of the editing functions with SEd. Many of these functions are based on classic Wordstar commands and are similar to commands used in many editors from Borland International - Sidekick, Sidekick Plus, Turbo Pascal, Turbo C, Turbo C++, Borland C++, Turbo BASIC, Turbo Prolog, etc... Many of the commands can also be executed with a mouse, if one is installed. Cursor Movement Commands Character Left Left Arrow Character Right Right Arrow Word Left [Ctrl] Left Arrow Word Right [Ctrl] Right Arrow Line Up Up Arrow Line Down Down Arrow Scroll up one line [Ctrl][W] Scroll down one line [Ctrl][Z] Page up [PgUp] Page down [PgDn] Beginning of line [Home] End of line [End] Top of window [Ctrl][Home] Bottom of window [Ctrl][End] Beginning of file [Ctrl][PgUp] End of file [Ctrl][PgDn] Beginning of block [Ctrl][Q][B] End of block [Ctrl][Q][K] Last cursor position [Ctrl][Q][P] Insert and Delete Commands Insert mode on/off [Ins] Delete character left of cursor [Backspace] Delete character at cursor [Del] Delete word right [Ctrl][T] Insert line [Ctrl][N] Delete line [Ctrl][Y] Delete to end of line [Ctrl][Q][Y] Block Commands Mark Block Shift Arrow Keys Mark beginning of block [Ctrl][K][B] Mark end of block [Ctrl][K][K] Mark word [Ctrl][K][T] Cut [Shift][Del] Copies deleted block to clipboard Paste [Shift][Ins] Inserts block from clipboard to file Delete Block [Ctrl][Del] Does not copy to clipboard Read block from disk [Ctrl][K][R] Write block to disk [Ctrl][K][W] Hide/Display block [Ctrl][K][W] Other Editing Commands Quit [Alt][X] File Open [F3] Go to menu bar [F10] Return to editor window from menu [Esc] Search [Ctrl][Q][F] Repeat last search [Ctrl][L] Search and Replace [Ctrl][Q][A] Tab [Tab] Batch File Utilities Many PC users consider themselves "non-programmers". They don't know or use a traditional language such as C, Pascal or BASIC, yet they have learned to do quite a bit with their computer. Often this is accomplished by writing batch files. Batch files are a standard ASCII text file that contains a series of instructions - commands, utilities and/or programs - each on a separate line. When executed, the operating system reads these batch files one line at a time and executes the commands on each line just as if they had been entered at the DOS prompt. The most common batch file is the AUTOEXEC.BAT file found on almost every computer. Although its not often thought of as such, batch is a powerful computer language that can be used for a variety of tasks. Many of the programs in the Eissinger Utilities are for use with batch files. There are two types of utilities for batch files. The first type is tools to help build batch files. Some of these are inspired by commands and features from the UNIX world. The second type of batch commands make up an extension to the batch programming language. These additions extend the power of batch and provide many more options than are available from just the internal and external DOS commands provided with DOS. Batch File Building Utilities The real power of MS-DOS can be harnessed when the user becomes proficient in writing DOS batch files. These utilities are designed to help make that process easier by providing tools to automate much of the actual assembly of a batch file. BldBat BLDBAT.EXE builds a skeleton batch file from a list of files, given a file spec, a batch file name and optional strings for leading and trailing the file name. BldBat provides some of the functions of the UNIX ls command. SYNTAX: BLDBAT +"ld string" -"end string" /o where Any valid DOS file mask (wildcards ok). These are the files to include in the resulting batch file. The name of the batch file to build. +"ld string" Any text to insert on each line prior to the file name. The [+] (plus) is required to tell it that this is leading text. If the string contains any spaces it must be enclosed in quotes ("). -"end string" Any text to insert on each line following the file name. The [-] (minus) is required to tell it that this is trailing text. If the string contains any spaces it must be enclosed in quotes ("). /O Overwrite. If specified BldBat will overwrite any existing . /P writes the full file path to the batch file. /H or ? as first parameter, displays syntax help. The ld and end strings can now include spaces, if the string is enclosed in quotes ("). The overwrite flag has been added. A header, including @ECHO OFF and the BldBat specs will be written to the resulting batch file. Example: Let's say that you want to compile all of the source code in a particular directory. To make command line compiling easier, you use a batch file called CMPL.BAT that already sets all of your default command line parameters for the batch file. But since your compile doesn't accept wild cards, you have two options - compile one file at a time, or build a batch file. The second method makes the most sense as it would allow you to walk away from your machine and let your computer do the work. BldBat can build that batch for you with the following command line . . . bldbat *.pas doit.bat +"call cmpl" where *.pas is the wildcard spec for the files to compile, doit.bat is the name of the resulting batch file and +"call cmpl" is the lead string. The lead string must be in quotes since it contains spaces. The following is the result of the preceding bldbat command . . . @echo off REM Batch File created by BldBat, Version 3.0 REM BldBat Copyright 1989-1991, Michael A. Eissinger, All Rights Reserved REM --------------------------------------------------------------------- REM REM File Spec : *.PAS REM Batch File : DOIT.BAT REM Lead String : call cmpl REM call cmpl LOG.PAS call cmpl MELD.PAS call cmpl GETYN.PAS call cmpl HEAD.PAS call cmpl BACKDROP.PAS call cmpl EKOFLASH.PAS call cmpl TAIL.PAS call cmpl BLDBAT.PAS call cmpl PUTCURS.PAS call cmpl DELDIR.PAS call cmpl PASTE.PAS call cmpl CASE.PAS call cmpl TODAY.PAS call cmpl REPEAT.PAS call cmpl KURSOR.PAS call cmpl COLOR.PAS call cmpl TONE.PAS call cmpl GETRESP.PAS call cmpl EKO.PAS call cmpl NOW.PAS call cmpl WAIT.PAS call cmpl EKOBOX.PAS call cmpl TYP.PAS call cmpl PAUSEC.PAS call cmpl DELETE.PAS call cmpl CHANGE.PAS call cmpl CLEAR.PAS call cmpl EXEC.PAS call cmpl COPY.PAS The call is required, since doit.bat is calling another batch file, and we want control to return to doit.bat following completion of cmpl.bat. This is a prime example of the power of BldBat. Meld Meld is a file combine utility. MELD takes two input files, reading one line from each and then writing them, one following the other to the output file. This is much like shuffling a deck of cards. Syntax: MELD /o where is the first file read, and subsequently will be the first line of each line pair. is the second file read, and subsequently will be the second line of each line pair. is the resulting melded file. /o Overwrite Flag. /H or ? as first parameter, displays syntax help. Several enhancements have been made to MELD.EXE. The overwrite flag has been added. A header, including @ECHO OFF and the bldbat specs will be written to the resulting batch file. example: if contains the following lines . . . file one line 1 file one line 2 . . file one line 99 and contains the following lines . . . file two line 1 file two line 2 . . file two line 99 Then outfile will look like this . . . file one line 1 file two line 1 file one line 2 file two line 2 . . file one line 99 file two line 99 Paste PASTE.EXE provides a function somewhat like the UNIX paste command. Like meld, it combines the contents of two files, producing a third file, however instead of writing separate lines, PASTE.EXE concatenates the corresponding lines, so that the resulting file contains the same number of lines as the longest of the two infiles. Additionally, PASTE.EXE offers the optional ability to specify leading, trailing and connecting text. Syntax: PASTE +"ld str" &"mid str" -"end str" /o where The first input file and will give the text that is first on each line. The second input file and will give the text that is second on each line. The resulting text file. +"ld str" Any leading text to place at the beginning of each line in outfile. The [+] (plus) is required to specify that this is leading text. If the string contains any spaces it must be enclosed in quotes ("). &"mid str" Any text to be placed between the text from the first and second files in the outfile. The [&] is required to specify that this is connecting text. If the string contains any spaces it must be enclosed in quotes ("). -"end str" Any text to be placed at the very end of each line in the outfile. The [-] (minus) sign is required to specify that this is trailing text. If the string contains any spaces it must be enclosed in quotes ("). /O Overwrite flag. If specified Paste will overwrite any existing file with the name. /H or ? as first parameter, displays syntax help. Note: leading, connecting and trailing text is completely optional and can be in any order, since their placement within the resulting outfile is determined by the [+], [&] and [-] characters. Several enhancements have been made to PASTE.EXE. The overwrite flag has been added. A header is written to the resulting text file. The ld, mid and end strings can now include spaces, by enclosing the string in quotes. If the mid str is a path name (ending in a backslash "\") no space will be inserted before the text from the second file. In prior versions the mid string was designated by a slash character [/]. This has been changed in Version 3.0 of the Eissinger Utilities, since the slash is used globally to indicate a command line switch. Example: lets examine the results of the following command line... PASTE infile1 infile2 outfile +copy &\hold\ if infile1 contains the following lines . . . file11 file12 file13 . . . file19 and infile2 contains the following lines . . . file21 file22 file23 . . . file29 Then outfile will look like this copy file11 \hold\file21 copy file12 \hold\file22 copy file13 \hold\file23 . . . copy file19 \hold\file29 By combining the power of BLDBAT.EXE, MELD.EXE and PASTE.EXE, you can generate quite useful and powerful batch files with the least amount of actual editing. Batch Language Extensions The next section of utilities are used during batch file execution. By adding additional input and output options to the batch language, these commands make possible screen displays so slick that most people won't know that you're at the DOS prompt, not running an application. Kursor Changes the cursor state. This is useful for turning the cursor on and off during batch file execution and for changing the size of the cursor on laptops. SYNTAX: KURSOR = restore to normal cursor KURSOR on = restore to normal cursor KURSOR off = turn cursor off, hidden cursor KURSOR fat = change to fat cursor KURSOR block = change to block cursor KURSOR /H or KURSOR ? = displays syntax help. PutCurs Puts the cursor on a particular line on the screen and optionally clears the entire screen, leaving the cursor on the specified line. SYNTAX: PUTCURS nn /c where nn a valid screen row /c clear the screen (optional) /H or ? as first parameter, displays syntax help. Screen Clearing DOS only provides CLS to clear the entire screen during display within a batch file. CLEAR provides a range of screen clearing options from a single line to a box. CLEAR also take into account the current screen attributes it is a perfect compliment to the COLOR command discussed later. Clear This program replaces ClrLine, ClrBox, ClrBelow and ClrAbove from version 2.0 of the Eissinger Utilities, and is an improved version of CLS, in that it provides support for the screen color attributes set by COLOR.EXE. SYNTAX: CLEAR Clears the screen, like CLS, except CLEAR retains any color attributes set by COLOR. CLEAR /L Clears the line specified by The cursor returns to the line from which CLEAR was called. Replaces ClrLine in version 2.0. CLEAR /A Clears from the line specified by to the top of the screen. The cursor returns to the line from which CLEAR was called. Replaces ClrAbove in version 2.0. CLEAR /B Clears from the line specified by to the bottom of the screen. The cursor returns to the line from which CLEAR was called. Replaces ClrBelow in version 2.0. CLEAR /X , , , All parameters should be one one line. = the X screen coordinate = the Y screen coordinate = the width of the box = the height of the box The cursor returns to the line from which CLEAR was called. Replaces ClrBox from version 2.0. CLEAR /H or CLEAR ? Displays syntax help. Color Clears the screen and changes the color of the screen display. SYNTAX: COLOR bg fg where bg the foreground color number fg the background color number /H or ? as first parameter, displays syntax help. valid colors . . . Color Number Word black 0 black blue 1 blue green 2 green cyan 3 cyan red 4 red magenta 5 magenta brown 6 brown light gray 7 lightgray dark gray 8 darkgray light blue 9 lightblue light green 10 lightgreen light cyan 11 lightcyan light red 12 lightred light magenta 13 lightmagenta yellow 14 yellow white 15 white Notes: Many DOS commands - cls, pause, echo, type, etc... will often display white characters on a black background. PAUSEC.EXE, EKO.EXE and TYP.EXE included with this the Eissinger Utilities correct this problem on most systems. COLOR.EXE will not work properly if ANSI.SYS is loaded into your CONFIG.SYS file. Since many of these utilities replace functions provided by ANSI.SYS it should be deleted. You can use COLOR.EXE to completely turn off display on your monitor by setting the background and foreground colors to the same value. The DOS CLS command will always remove the color attributes set by COLOR.EXE, as will some other programs upon completion. Border Changes the color of the border around the screen display. SYNTAX: BORDER bg fg where bg = the background color fg = the foreground color See COLOR.EXE for a full listing of available colors. BackDrop BACKDROP.EXE is one of those commands that is so simple that no one has ever thought to write it, but the results can add a lot of snap to a batch file. Novell styles menus, and many other standards interfaces (such as Borland's Turbo Vision) use a background behind everything. Normally, these backdrops are nothing more than a full screen of the half-tone block characters from the standard character set. BACKDROP.EXE provides a quick method of putting up this kind of backdrop in a batch file. The three different half-tone blocks can be used to vary your display. SYNTAX: BACKDROP = fill backdrop with default character BACKDROP 1 = fill backdrop with lightest character BACKDROP 2 = fill backdrop with medium character (default) BACKDROP 3 = fill backdrop with darkest character The bottom line (line 25) will be left blank. This is deliberate to provide a location for you to position any display or other text that you don't want to obliterate the backdrop. EkoBox can be used to pop a window or a series of windows on top of the backdrop. Study the GRMENU.BAT file for an example of using COLOR, BACKDROP, PUTCURS, EKOBOX, and GETRESP of how to build a menu in a batch file. ECHO Enhancements DOS uses the ECHO command to put text onto the screen during batch file execution. ECHO is extremely limited as to any fancy displays of text. Various utilities in the Eissinger Utilities provide enhanced display options for use with batch files. There are three variations of the ECHO command included in Version 3.0 of the Eissinger Utilities that can provide a wide range of display possibilities that can not be achieved with ECHO. Eko Unlike ECHO, which displays text specified on the line within the batch file, EKO.EXE uses an external text file. Instead of telling EKO.EXE the text to be displayed, EKO.EXE uses the line numbers of the text within the secondary text file. Version 3.0 of the Eissinger Utilities provides EKO.EXE with the ability to display multiple lines from a single call. This is much faster than using multiple ECHO calls to display more than one line of text. SYNTAX: EKO nnn1 nnn2 /option where the text file nnn1 the first line of text within the file to display. If only the first line number is specified in the call to EKO, just that one line will be displayed. nnn2 the last line of text within the file to display. (optional) /option the case option. /u = upper case /l = lower case EkoFlash To display a string of text in the currently set background color use the standard DOS ECHO command or the EKO. EKOFLASH is a very fancy variation of ECHO that puts the string onto the screen flashing in user specified colors. This is perfect for those "Please wait . . ." messages. SYNTAX: EKOFLASH bc fc "echo string" where bc background color fc foreground color "echo string" the string to flash /h or ? display syntax help See the COLOR.EXE command for a complete list of background and foreground colors. The "echo string" must be enclosed in quotes if it contains any spaces. EkoBox ECHOBOX goes even farther than EKO or EKOFLASH. EKOBOX.EXE puts one or more lines of text into a box, centered on the screen. The text can be static or flashing and it can be left justified or centered within the box. The box can be made from a single or a double line and the box can optionally have a black drop shadow. SYNTAX: EKOBOX bc fc "echo string 1" ... "echo string n" /f /d /s /c where bc background color fc foreground color "echo string 1" to "echo string n" the strings to display - one string per line within the box. The echo strings must be enclosed in quotes if they contain any spaces. The maximum number of strings that can be displayed is 21. /f cause the text to flash /d double line box (the default is single line) /s add a drop shadow to the box /c center the text within the box (the default is left justify) See COLOR.EXE for a complete list of background and foreground colors. Be careful when writing EKOBOX commands within a batch file. If the line is too long to be accepted by the command line, it will possibly cause the machine to lock up. The maximum number of characters that can be used on a single line is 128. This is a limitation of DOS. Examine the GRMENU.BAT sample file for an example of how to use EKOBOX. GRMENU.BAT uses the following logic to put a fancy menu on the screen . . . COLOR.EXE sets background/foreground colors BACKDROP.EXE puts up a block background PUTCURS.EXE positions the cursor EKOBOX.EXE puts up a title PUTCURS.EXE positions the cursor EKOBOX.EXE pops up the menu GETRESP.EXE accepts the user's responses Seven commands for a complete batch file menu that will have your user's thinking that they're using a custom application. User Response Batch Entry Utilities Another function missing from DOS is the ability to accept user input during batch execution. The next utilities provide for some level of user entry. They allow the user to tap a single key and then the batch program can branch based on the key tapped. GetResp Display a prompt on the screen and wait for a key to be pressed. The result of the keypress is returned in DOS's ErrorLevel and can be checked in a batch file. GetResp will only function with the letters A - Z and digits 0 - 9. Consult the GRMENU.BAT file for an example of how to use GETRESP.EXE. SYNTAX: GETRESP "display string" letterset /c where "display string" The prompt to display. The display string must be enclosed in quotes if the string contains spaces. letterset characters for input. If the user attempts to enter a letter or number not included in the letterset GETRESP will ignore the entry. If no letterset is specified, GETRESP will accept all numbers and letters /c Clear. If set the keyboard buffer is cleared before entry. /h or ? display syntax help The following is a complete list of characters and the resulting ErrorLevels. Char EL Char EL Char EL Char EL Char EL 0 48 1 49 2 50 3 51 4 52 5 53 6 54 7 55 8 56 9 57 A 65 B 66 C 67 D 68 E 69 F 70 G 71 H 72 I 73 J 74 K 75 L 76 M 77 N 78 O 79 P 80 Q 81 R 82 S 83 T 84 U 85 V 86 W 87 X 88 Y 89 Z 90 Note: when checking the errorlevels within the batch file, always check in descending order. The equals "==" function in batch files really means >= (greater than or equal to). If you put the errorlevel checking in ascending order you will never get acceptable results. GetYN Like GetResp, displays a prompt and waits for a key to be pressed, however GETYN only responds to [Y] or [N], returning 1 in ErrorLevel if [Y], 0 if [N], all other keys have no effect and GETYN will wait until either [Y] or [N] is pressed. SYNTAX: GETYN "disp str" /c where "disp str" the prompt to display. The display string must be enclosed in quotes if the string contains spaces. /c clear. If set the keyboard buffer is cleared before entry PauseC Everyone who has written a batch file has used the DOS command PAUSE. PAUSE displays a message on the screen and suspends the execution of the batch file until a key is pressed. When PAUSE is used on some system in conjunction with the COLOR command, the message is displayed in white characters on a black background, regardless of the colors set with the COLOR.EXE command. PAUSEC.EXE is an enhanced PAUSE command with additional functions. SYNTAX: PAUSEC bg fg /Wnnn where bg background color fg foreground color /Wnnn Optional: The wait value. nnn is an approximate number of seconds to wait for a keypress. If no keypress is issued by the end of that time, the PAUSEC will terminate and execution of the batch file will continue. If the wait value is not included, PAUSEC will function exactly like PAUSE. /H or ? display syntax help PAUSEC.EXE checks the current screen attributes (color & intensity) and uses those attributes for the pause display unless the user specifies new background and foreground colors. PAUSEC.EXE has been included in this section with the User Response utilities because PAUSEC returns a value in errorlevel upon completion, so that the batch file can branch based on the result of that errorlevel. This lets you determine how PAUSEC.EXE terminated. If PAUSEC terminates due to a keypress, the errorlevel will be Zero (0). If PAUSEC terminates due to an error, the errorlevel will be One (1). If PAUSEC terminates due to a timeout, the errorlevel will be Two (2). Time/Date Utilities The next two utilities are generally used for display during batch files. For an example, study the CLOCK.BAT file. Although DOS does provide built in functions for changing both the system date and time, it does not provide a simple means to display either in a batch file. The next two utilities provide those functions. Now Displays the current system time. SYNTAX: NOW /options where /options = /m /s /f and/or /a /m displays the current time in military time /s include seconds /f include the fraction of the seconds, if /s is also specified. /a include am/pm - can't be used in military format. /h or ? display syntax help Today Displays the current date on the screen. SYNTAX: TODAY /options where /w include Day of the Week (full word) /s include Day of the Week (three characters only) /2 use 2 digit year (defaults to 4 digit year) /h or ? display syntax help Tone Tone allows the user to Generate a tone or a series of tones, altering the frequency, duration and number of times that the tone repeats. SYNTAX: TONE /f220 /r10 /d200 /p100 where /fnnn the frequency /rnnn the number of times to repeat /dnnn duration /pnnn duration of pause /h or ? display syntax help All parameters are optional and can be specced in any order as long as they are specced using the /f, /r, /p and /d identifiers. The defaults are /f220, /d200, /p = duration /r1 Version 3.0 of TONE also provides several special effects. These effects are not altered by any of the above options for frequency, duration or repeat. They should be specified alone. TONE /shots TONE /phaser1 TONE /phaser2 TONE /phaser3 TONE /phaser4 TONE /phaser5 TONE /phaser6 TONE /up TONE /down TONE /crickets TONE /zap TONE /zoom TONE /falling TONE /bounce TONE /alarm TONE /siren TONE /coin Extensions to DOS In addition to the various batch programming enhancements provided by the Eissinger Utilities, Version 3.0, several DOS enhancements are also included. These are generally similar to original DOS commands, or provide services not normally included in DOS. These utilities are intended to supplement, not replace, similar functions in DOS. One of the most basic functions performed at the command line must be deleting files. DOS has always provided a simple mechanism for these called, originally, ERASE or DEL. With the addition of a Unix-like sub-directory structure in DOS 2 the RMDIR or RD command was added to delete directories. DEL is unforgiving and deletes exactly what you tell it to (finally, with DOS 5.0, there's a way to undelete files), and RD will only delete directories that are already empty. These next two utilities are intended to supplement DEL and RD. Delete DELETE.EXE provides one simple enhancement over the DOS DEL or ERASE command. DELETE asks the user to verify the deletion of each file prior to actually erasing the file from the disk. SYNTAX: DELETE where the file or files to be deleted. Wildcards are accepted. /h or ? display syntax help DelDir DELDIR.EXE combines the standard DOS DEL and RD commands into a single operation. DELDIR first deletes all of the files contained with a directory and then removes the directory. Like RD, if there are child directories under the specified directory, DELDIR will not be able to remove the directory. SYNTAX: DELDIR where the directory to be removed. /h or ? display syntax help Kopy There has always been a need to transfer files from one location to another. Until DOS 3 there was only the COPY command. XCOPY has been added to allow sub-directories to be copied, along with several other options. One function that has never been addressed in any version of DOS was to allow COPY or even XCOPY to copy more files than would fit on a single diskette. Both COPY and XCOPY will terminate with an error when they attempt to copy a file that is too big to fit onto the disk. Not only is this annoying, but it means that if you need to copy many files you will have to do it in several steps. KOPY.EXE has been provided with the Eissinger Utilities, Version 3.0 to fill this void. KOPY.EXE is not a general purpose replacement for the COPY command, it is only provided for those times when you need to fit many files onto a diskette. SYNTAX: KOPY d: where file or files to copy to diskette d: the diskette drive letter. Only drives a: thru f: are supported, and the drive can NOT be the current drive. /h or ? display syntax help Exec Batch files are normally used to chain or batch a string of commands into a single executable file. Many of the utilities in the Eissinger Utilities are specifically for use within batch files. There are problems with batch files, however. If you need to string just a few commands together, a batch file takes time to write, and batch file execution is slow. EXEC.EXE is not intended to replace batch files, it is included as a mechanism to execute a few command quickly in sequence for those times when a batch file is not needed. SYNTAX: EXEC "program.ext 'params'" "program.ext 'params'"... where program.ext the program to execute. The path is not searched. The entire path name of the program must be included - including the extension. 'params' any command line parameters to be passed. the parameters MUST be enclosed in single quotes, even if they contain no spaces. /h or ? display syntax help NOTE: Each command line MUST be enclosed in double quotes (") if it contains any spaces. The command line parameters MUST designated in single quotes. The command line parameters are optional. Up to 50 separate command lines can be passed, as long as the total EXEC command line does not exceed DOS's limit. None of the Eissinger Utilities that require parameters to be sent in double quotes can be used with EXEC.EXE, since the command line parsing will not allow double quotes to be contained within other strings. These utilities can be used if only single word parameters are passed. You will have to experiment with these. Using EXEC.EXE to execute INTERNAL DOS commands is another special case. EXEC.EXE does not actually execute INTERNAL commands like COPY, DEL or DIR. These commands are actually parameters that DOS passes to the program COMMAND.COM. If you want to execute one of the INTERNAL commands with EXEC.EXE you will have to execute COMMAND.COM and pass the function (DIR/DEL/COPY/etc...) as the command line parameters. It sounds backwards, but that's exactly what DOS does when it executes any of these INTERNAL commands. Repeat There may be times when you want to execute a command several times. Repeat provides that facility. SYNTAX: Repeat /Rnnn where the command to execute. Must includes the full filename and or path. /Rnnn where nnn = the number of times to repeat the command any command line parameters /h or ? display syntax help The same rules apply to Repeat as do Exec about internal DOS commands. See Exec for complete details. CompText This small utility provides an enhanced file compare function, specifically for text files. SYNTAX: COMPTEXT /p /c where = first file for compare = second file for compare /p = send non-matching records to printer /c = ignore case differences. Unlike the COMP command in DOS, COMPTEXT works only with text files. COMPTEXT also allows the user to step through the files when a non-matching record is located. By tapping the [1] key the first file is advanced by one record. Tapping the [2] advances the second file. [G] tells COMPTEXT to go to the next non-match. [Esc] aborts COMPTEXT. FF (Form Feed) There are times when you may want to advance your printer, flushing a partial page from the print buffer. This is especially helpful when using laser printers, when your printer is not close to your desk or when you want to use a batch file to copy a number of text files to your printer. SYNTAX: FF = issues a form feed. FF /? or FF /h = displays syntax help. Issuing FF from the command line, or as a line in a batch file will force a form feed to be sent to the default printer. Note: Some other utilities contain a file FF.EXE or FF.COM for FindFile. If you have one of these utilities and both are in the path, the first one found will be executed. You can rename either this FF.EXE to something else, (FORMFEED.EXE) or the other utilities (FINDFILE.EXE) to eliminate this conflict. Log Log provides a mechanism to write to a log file. The log entry includes the time and date that the logging function happened. SYNTAX: LOG "text to post" /o where = the name of the log file "text to post" = the text to post to the log file. /o = overwrite existing log file. If the text to post includes spaces, it MUST be enclosed in double quotes. If doesn't exist LOG will create it. The overwrite flag (/O) will delete any existing and create a new one, with this entry as the first log entry in the file. A header is written to each log file indicating the date and time of the creation of the log file. If the creation of the log file overwrote an existing file it will be indicated in the header. Typ TYP adds a couple of features to the normal DOS TYPE command. Color TYP uses the current screen attributes for type. On some display adapter/monitor combinations, TYPE will always display white text on a black background. This is not all that desirable when using the COLOR.EXE command. TYP corrects this limitation of the original TYPE command and uses the current screen attributes for display. Pause TYP automatically pauses after one full screen of text, and at the end of the text file. This means that within a batch file, several screens of instructions can be displayed, and the user does not have to attempt to pause the screen as the text flies by. Case TYP can display the text as it was originally entered into the text file, or it can optionally convert all text to either upper or lower case. SYNTAX: TYP /option where The text file - the source of the line(s) to echo. /option the case option /u = force display to upper case /l = force display to lower case /h or ? display syntax help Note: Unlike TYPE, TYP can not be used to redirect a file to the printer, a file or other device. TYP is strictly intended to display text on the system's monitor. Text File Utilities An area where UNIX shines and DOS falls short is text file utilities. There are many public domain, shareware and commercial utilities that help fill that gap. Here are some more to help round out your standard array of text file utilities. Head Two of the utilities that UNIX provides that are missing from DOS are HEAD and TAIL which allow you to display or print the beginning or end of a file respectively. Although these are generally considered programmer's utilities they are also useful when examining any type of text file. HEAD.EXE prints the first section of a text file to the screen or the printer. SYNTAX: HEAD nn /option where the text file nn number of lines to extract (default 20) /option output options /u - force to upper case /l - force to lower case /p - send output to printer ? or /h display syntax help Tail TAIL.EXE prints the last section of a text file to the screen or the printer. SYNTAX: TAIL nn /option where the text file nn number of lines to extract (default 20) /option output options /u - force to upper case /l - force to lower case /p - send output to printer ? or /h display syntax help Case Converts the entire contents of a text file to either upper or lower case. SYNTAX: CASE /case where name of the file to convert /case case option /l - lower case (default) /u - upper case ? or /h display syntax help System Requirements The Eissinger Utilities requires the following minimum hardware configuration. Any IBM PC/XT/AT/386 or PS/2 or fully compatible computer. If it runs generic MS/DOS or PC/DOS the Eissinger Utilities will run. The memory requirements of all of these utilities vary, however all of them will run with a minimum of 128k RAM. Any monochrome or color video card/monitor combination can be used, however some of these utilities are designed primarily for color systems. Many of the utility programs in the Eissinger Utilities send their output to the system's printer, however a printer is not required to run any of the programs in the package. Notes from the Author I originally developed the core of this package to fill certain needs that I had as a programmer and a PC Consultant. As the time went on the package grew. This was due to additional requirements of my own and suggestions from users. The original package, called TP4Util was designed for Turbo Pascal programmers and was originally released shortly after Borland International released Turbo Pascal 4.0. TP4Util contained several programmers utilities and some TP4 Units. By the time Turbo Pascal 5.0 and 5.5 were released the units were obsolete. TP4Util had only limited DOS utilities. BldBat and PutCurs were about the only ones that were included. Version 2.0 of the utilities was renamed the Eissinger Utilities - not as egocentric as it might seem. With a last name like mine, I figured they could never be confused with another package. The name change was prompted by the fact that this version of the utilities was less a set of programmer's utilities and more of a general purpose DOS enhancement package. Unix-like commands - Paste, Meld, Head and Tail were added, along with versions of most of the batch display and input commands. HWare was also included in Version 2.0. There were no revisions between 1989 and 1991. Several events in the summer and fall of 1991 prompted me to begin revising the set. Digital Research released DR DOS 5.0, followed shortly by MS-DOS 5.0 from Microsoft, followed again in the early fall by DR DOS 6.0 from DRI. These new operating systems were significant improvements over MS/PC-DOS 3.3 and 4.0/4.1, and many people were making the switch. In the October, 1991 issue of PC Computing, Preston Gralla wrote an article reviewing several shareware packages that were good enhancements to the new versions of the operating system. One of the ones included was the Eissinger Utilitites, Version 2.0. This motivated me to take a good look at that version and see if it needed to be revisited. On October 15, 1991, I received a call from a young lady doing research for a new book on shareware - also published by Ziff Davis. The Eissinger Utilities are to be included in the book. This added even more motivation. I carefully went through Version 2.0 and examined each program. I then did what most programmers would consider unthinkable - I archived the source code and deleted it from my system. I started from scratch and rewrote every program in the set. This forced me to rethink each program. I eliminated as much fat as possible. I wrote new command line parsing routines. In short, I started with a clean slate. I left out little used functions and added new ones. The result is a greatly enhanced set of utilities. Some of the existing programs - MemChk, for example - were no longer needed as they have been supplanted by programs in the newer operating systems. I combined some of the previous utilities - ClrAbove, ClrBelow, ClrLine and ClrBox into a single utility - Clear. I added new functions to almost every program - BldBat, Meld, Paste, Color, Eko, GetResp, GetYN, Head, Tail, Tone, PauseC, Today and Now are all enhanced. New programs were added - EkoBox, EkoFlash, Repeat, Wait, Log. HWare was completely redesigned and rewritten. So many functions and features were added that over half of the user's guide was dedicated just to the one program. HWare is now a full-blown system and configuration utility, perfect for Network Administrators or PC Managers needing to track a large number of stand-alone or networked PC's, or for consultants or contract programmers working on a variety of different machines. Since it has been expanded so much, and the focus is quite different from the rest of the Eissinger Utilities, HWare has been removed and released as a separate product. I mentioned in the documentation for Version 2.0 that I had considered splitting the Eissinger Utilities into two separate sets. One general purpose set, one for Pascal programmers. Since the Pascal world has changed drastically with the release of Turbo Pascal 6.0 and Turbo Pascal for Windows from Borland International, the original Pascal utilities that have been carried along since TP4Util are completely out of date. They need to be revised to reflect the changes in the language. These programs are also of little or no interest to non-Pascal programmers. Therefore, they have been removed from the Eissinger Utilities, Version 3.0 and may be released as a separate package, sometime in the future, after a set of Windows 3.0 utilities are completed and released. These Windows utilities are currently under development and will be available soon. I would be grateful for any feedback from you, the user. Let me know of other DOS or batch utilities that would be helpful, or changes/enhancements you'd like to see in future versions of the existing programs. Most of the new programs and enhancements in Version 3.0 are the direct result of requests from users. I hope that you find these programs as useful as I have. I use most of them daily. They were a joy to write and I'm very proud to have you use them. I want to thank several people who contributed, in their own ways, to these utilities. Steven Powell of UCLA Capital Programs for testing these utilities, and suggestions. Marie M. Carlson, for having a sharp eye and for general support and encouragement. Corkey Ragsdale for support and motivation. Julia, Cindy and Bill at Borland International for their time, energy and patience. Shareware The Eissinger Utilities are distributed as Shareware. The software described in this document is distributed free or at minimal charge for evaluation only. Users of this software are to license this software according to the instructions given in this document. Copies of this software may be made only in accordance with instructions given in this document. Upon receipt of registration, the user will receive the latest copy of the software, along with a printed manual and will be able to receive free phone support. Additionally, registered users will receive a free copy of the Windows 3.0 utilities currently under development as soon as they become available. Registration/Order Form Item Quantity X Price = Total Disk 3.5" ________ X 25.00 = ________ Disk 5.25" ________ X 25.00 = ________ TOTAL = ________ Name _____________________________________________ Address 1 _____________________________________________ Address 2 _____________________________________________ City/State/Zip _____________________________________________ Phone _____________________________________________ Please Mail, with Payment to . . . Michael A. Eissinger Microcomputer Consultant 346 East Cedar Hanford, CA 93230